import { BaseSkill } from '../BaseSkill';
import { DamageType, SkillType } from '../../types';
import { General } from '../../models/General';
import { Battle } from '../../models/Battle';

export class RuiBuKeDang extends BaseSkill {
  private readonly DAMAGE_BOOST = 0.3;  // 30% 伤害提升

  constructor() {
    super(
      'ruiBuKeDang',
      '锐不可当',
      SkillType.Active,
      DamageType.None,
      0.5,        // 50% 触发概率
      4,          // 4回合CD
      2           // 2回合持续
    );
  }

  execute(source: General, battle: Battle): void {
    if (!this.canUse() || Math.random() > this.probability) return;

    // 添加物理伤害提升效果
    source.addEffect({
      type: 'physicalDamageBoost',
      value: this.DAMAGE_BOOST,
      duration: this.duration,
      stackable: true,
      source: this.id,
      timestamp: Date.now()
    });

    // 添加谋略伤害提升效果
    source.addEffect({
      type: 'strategyDamageBoost',
      value: this.DAMAGE_BOOST,
      duration: this.duration,
      stackable: true,
      source: this.id,
      timestamp: Date.now()
    });

    this.startCooldown();
  }
}
